The app, runs a cron job every minute in the code and fetch's data from Github Public Repo and updates as changes reflected on the file.
- Clone the project
git clone [email protected]:Anish-Shobith/akto-app.gitNote: I use
ssh, you can usehttpsoverssh.
- Change Directory
cd akto-app- Install the dependencies (I use yarn hence)
yarn install- Make necessary changes in the
.env.examplefile for database connection. (That is provide a Database URL) and importantly rename.env.exampleto.env
DATABASE_URL="mongodb+srv://<username>:<password>@cluster0.ijkiuxr.mongodb.net/<dbname>?retryWrites=true&w=majority"
Note :
Replace <username> with your username.
Replace <password> with your password.
And Finally replace <dbname> with your dbname, you can keep akto-app.
I am using Mongodb Atlas, a Tutorial on setup of the Cluster can be found in here.
- Start the app, this will call the
startscript in thepackage.json, which
yarn start
Output:
Cron job started successfully.
... After 1 Minute
Data fetched and stored successfully.
... After 1 Minute
Data fetched and stored successfully.
If Error:
Error fetching and storing data: Error Information
- MongoDB Atlas
- typescript (Programming Language)
- prisma (Database ORM)
- @octokit/rest (API to interact with GitHub)
- winston (Logger)
- yarn (Package Manager)