{"id":23006641,"url":"https://github.com/ishaan400/api-skull-as-begginer","last_synced_at":"2026-04-10T14:36:26.217Z","repository":{"id":266411741,"uuid":"898276483","full_name":"Ishaan400/API-SKULL-as-Begginer","owner":"Ishaan400","description":" API REST skeleton written on JavaScript using async/await. Great for building a starter web API for your front-end (Android, iOS, Vue, react, angular, or anything that can consume an API)  This project is created to help other developers create a basic REST API in an easy way with Node.js.","archived":false,"fork":false,"pushed_at":"2024-12-04T06:10:58.000Z","size":204,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T06:14:45.372Z","etag":null,"topics":["async-await","bcrypt","caching","chai","eslint","expressjs","javascript","jwt-authentication","mocha","mongodb","mvp","nodejs","npm","postman","redis","rest","script","testing","token"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ishaan400.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-04T05:28:56.000Z","updated_at":"2024-12-04T06:50:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"72e1fd6c-faf1-4de5-b597-a4737016b3f3","html_url":"https://github.com/Ishaan400/API-SKULL-as-Begginer","commit_stats":null,"previous_names":["ishaan400/api-skull-as-begginer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishaan400%2FAPI-SKULL-as-Begginer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishaan400%2FAPI-SKULL-as-Begginer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishaan400%2FAPI-SKULL-as-Begginer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ishaan400%2FAPI-SKULL-as-Begginer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ishaan400","download_url":"https://codeload.github.com/Ishaan400/API-SKULL-as-Begginer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246837685,"owners_count":20841903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async-await","bcrypt","caching","chai","eslint","expressjs","javascript","jwt-authentication","mocha","mongodb","mvp","nodejs","npm","postman","redis","rest","script","testing","token"],"created_at":"2024-12-15T08:13:12.716Z","updated_at":"2025-12-30T19:11:42.359Z","avatar_url":"https://github.com/Ishaan400.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# API-SKULL-as-Begginer\n API REST skeleton written on JavaScript using async/await. Great for building a starter web API for your front-end (Android, iOS, Vue, react, angular, or anything that can consume an API)  This project is created to help other developers create a basic REST API in an easy way with Node.js.\n\n\nFeatures\nMultiple environment ready (development, production)\nCustom email/password user system with basic security and blocking for preventing brute force attacks.\nCompressed responses.\nSecured HTTP headers.\nCORS ready.\nCache ready (Redis).\nHTTP request logger in development mode.\ni18n ready (for sending emails in multiple languages).\nUser roles.\nPagination ready.\nUser profile.\nUsers list for admin area.\nCities model and controller example.\nLogin access log with IP, browser and country location (for country it looks for the header cf-ipcountry that CloudFlare creates when protecting your website).\nAPI autogenerated documentation by Postman.\nAPI collection example for Postman.\nTesting with mocha/chai for API endpoints.\nNPM scripts for cleaning and seeding the MongoDB database.\nNPM script for keeping good source code formatting using prettier and ESLint.\nUse of ESLint for good coding practices.\nMailer example with Nodemailer and Mailgun.\nAbility to refresh token\nJWT Tokens, make requests with a token after login with Authorization header with value Bearer yourToken where yourToken is the signed and encrypted token given in the response from the login process.\n\n\nRequirements\nNode.js 10+\nMongoDB 3.6+\nRedis 5.0+\n\nSetting up environments (development or production)\nIn the root this repository you will find a file named .env.example\nCreate a new file by copying and pasting the file and then renaming it to just .env\nThe file .env is already ignored, so you never commit your credentials.\nChange the values of the file to your environment (development or production)\nUpload the .env to your environment server(development or production)\nIf you use the postman collection to try the endpoints, change value of the variable server on your environment to the url of your server, for development mode use http://localhost:3000\n\n\nTo ensure the deliverability of emails sent by this API, Mailgun is used for mailing users when they sign up, so if you want to use that feature go sign up at their website https://www.mailgun.com\n\n\nHow to run\nDatabase cleaning and seeding samples\nThere are 3 available commands for this: fresh, clean and seed.\n\nnpm run command\nfresh cleans and then seeds the database with dynamic data.\nclean cleans the database.\nseed seeds the database with dynamic data.\nRunning in development mode (lifting API server)\nnpm run dev\nYou will know server is running by checking the output of the command npm run dev\n\n****************************\n*    Starting Server\n*    Port: 3000\n*    NODE_ENV: development\n*    Database: MongoDB\n*    DB Connection: OK\n****************************\nRunning tests\nIt´s a good practice to do tests at your code, so a sample of how to do that in mocha/chai is also included in the /test directory\n\nnpm run test\nFormatting code\nFormat your code with prettier by typing:\n\nnpm run format\nFormatting markdown files\nFormat all your markdown files with remark by typing:\n\nnpm run remark\nLinting code\nLint your code with ESLint by typing:\n\nnpm run lint\nUsage\nOnce everything is set up to test API routes either use Postman or any other api testing application. Default username/password combination for login is admin@admin.com/12345.\n\nAPI documentation\nhttps://documenter.getpostman.com/view/487539/RWaHwoLV\n\nPostman API example collection\nYou can import the example collection to Postman. To import, click the import button located and select postman-example.json located within the root directory.\n\nGo to manage environments to create environments for development, production, etc. On each of the environments you create you will need to:\n\nCreate a new key authToken and within the /login request this value is automatically updated after a successfull login through a script located in the tests tab. Each time you make a request to the API it will send Authorization header with the token value in the request, you can check this on the headers of users or cities endpoints in the Postman example.\n\nCreate a second key server with the url of your server, for development mode use http://localhost:3000\n\nThis is a REST API, so it works using the following HTTP methods:\n\nGET (Read): Gets a list of items, or a single item\nPOST (Create): Creates an item\nPATCH (Update): Updates an item\nDELETE: Deletes an item\nCreating new models\nIf you need to add more models to the project just create a new file in /app/models/ and it will be loaded dynamically.\n\nCreating new routes\nIf you need to add more routes to the project just create a new file in /app/routes/ and it will be loaded dynamically.\n\nCreating new controllers\nWhen you create a new controller, try to also create another folder with validations and helpers. Ex. /countries, /countries/validators and /countries/helpers. An example of this is included in the repository.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fishaan400%2Fapi-skull-as-begginer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fishaan400%2Fapi-skull-as-begginer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fishaan400%2Fapi-skull-as-begginer/lists"}