Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andromedatechnology/firestarter-api
🚀 Easy to extend, Progressive and Scalable API boilerplate to power your startup.
https://github.com/andromedatechnology/firestarter-api
api boilerplate koa nodejs starter startup startup-template template typescript
Last synced: about 2 months ago
JSON representation
🚀 Easy to extend, Progressive and Scalable API boilerplate to power your startup.
- Host: GitHub
- URL: https://github.com/andromedatechnology/firestarter-api
- Owner: AndromedaTechnology
- License: mit
- Created: 2021-10-14T00:48:14.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-05T09:02:03.000Z (6 months ago)
- Last Synced: 2024-07-23T10:21:38.908Z (6 months ago)
- Topics: api, boilerplate, koa, nodejs, starter, startup, startup-template, template, typescript
- Language: TypeScript
- Homepage: https://andromeda.technology
- Size: 107 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
Firestarter API - Progressive Startup API Boilerplate
Progressive Startup API Boilerplate
https://firestarter-api.andromeda.technologyEasy to extend, Progressive and Scalable API boilerplate to power your startup.
## 1. Technology
- [TypeScript](https://www.typescriptlang.org/),
- [Koa.js](https://koajs.com/),
- Database: [MongoDB](https://www.mongodb.com/): [Mongoose](https://mongoosejs.com/),
- Config: [Dotenv](https://www.npmjs.com/package/dotenv), [Joi](https://joi.dev/),
- Testing: [Jest](https://jestjs.io/): SuperTest, MongoDBMemoryServer,
- [Docker](https://www.docker.com/): MongoDB.## 2. Usage
1. Clone the repo,
2. Duplicate `.env.example` files in [`./`,`/docker/`] to `.env`; modify as needed,
3. Have `Docker` [installed](https://www.docker.com/get-started), run the containers and your app (check the instructions below),
4. Add modules (routes, controllers, services, tests) to `/src` (duplicate Message module, adjust to your needs),
5. List newly added modules (features) here (Readme.md) and in your POSTMAN collection.## 3. Features
1. Message Module,
2. [Add your modules/features here]All API routes are prefixed by `API_PREFIX` (defined in`.env`) (default: `/api`).
## 4. Setup
**Docker**
Docker provides isolated `MongoDB` for your project.
```
cd ./docker# Duplicate example env file, modify as needed
cp .env.example .envdocker-compose up -d
```**Application**
```
# Return from `docker` to root dir
# cd ..# Duplicate example env file, modify if needed
cp .env.example .env# Install packages
npm i# Run
npm run dev
```## 5. Tests
Using `Jest` Testing Framework.
Jest uses `SuperTest` and `MongoDBMemoryServer`.
```
npm run test
```## 6. Postman
[Postman Documentation](https://documenter.getpostman.com/view/97483/UUy67k8N)
- (Link your Postman Documentation here)
Pre-set environment variables:
- `host`
- `admin_password`Dynamic environment variables,
automatically set in tests:- `access_token`
## 7. Admin Routes
Routes can be protected with `jwtCheck` middleware,
requiring admin rights.Requests going to these routes require `Authorization: Bearer {access_token}` header.
**List of protected, i.e. Admin Routes**
1. Message[Create,Update,Delete],
2. [Add your protected routes here]**Getting access_token for the Admin user**
- Request endpoint: `POST /auth/token`,
- Pass your password in the request body: `{ password: ADMIN_PASSWORD }`,
- Response will return created `token`.Note: Postman collection will automatically set `access_token` environment variable,
so you can immediately call admin routes, without copy-pasting it or setting the env variable manually.**Getting the ADMIN_PASSWORD**
- Your `ADMIN_PASSWORD` is defined in `.env` file.
- It defaults to `secret`.## 8. Deployment
If you use MongoDB Atlas: Uncomment and fill `DB_URI` in `.env`.
## 9. Social
Andromeda
- [Medium](https://medium.com/andromeda-technology)
- [Twitter](https://twitter.com/andromeda_node)## 10. Rest
Hero image source: [FireStarter, gilad, DevianArt](https://www.deviantart.com/gilad/art/Firestarter-25634515).
## 11. Related
[🏄 Habitus](https://github.com/AndromedaTechnology/habitus)
- State-of-the-art tracker for emotions, habits and thoughts,
- Healthiest version of you,
- Gamified,
- Anonymous and open source.## 12. Contribute
Check [Self-Aware Software Artisan](http://selfawaresoftwareartisan.com) before contributing.
Started in Europe, Croatia 🇭🇷
Crafted with ❤️
by contributors around the 🌍 World and 🌌 Andromeda.