https://github.com/andromedatechnology/startedincroatia-api
Best of Croatia
https://github.com/andromedatechnology/startedincroatia-api
Last synced: about 1 month ago
JSON representation
Best of Croatia
- Host: GitHub
- URL: https://github.com/andromedatechnology/startedincroatia-api
- Owner: AndromedaTechnology
- Created: 2022-12-12T23:20:07.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-12-13T03:20:48.000Z (over 3 years ago)
- Last Synced: 2025-01-18T14:46:01.252Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://startedincroatia.com
- Size: 172 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Started In Croatia.com
API for [**StartedInCroatia**](https://startedincroatia.com) [[Github - Frontend](https://github.com/AndromedaTechnology/startedincroatia)].
```
Started in Croatia.
Open-Source.
```
# 1. Technology
- TypeScript
- Koa.js
- Database: MongoDB: Mongoose
- Config: Dotenv, Joi
- Testing: Jest: SuperTest, MongoDBMemoryServer
- Docker: MongoDB
# 2. Features
- 🥰 Link CRUD
- 🔐 JWT auth for Admin actions
# 3. Run
**Docker**
Runs `MongoDB` container.
```
cd docker
cp .env.example .env
docker-compose up -d
```
**Application**
```
# Return to root
cd ..
cp .env.example .env
npm i
npm run dev
```
# 4. Tests
Using `Jest` Testing Framework.
Jest uses `SuperTest` and `MongoDBMemoryServer`.
```
npm run test
```
# 5. Postman
Check out [Postman Documentation]().
Pre-set environment variables:
- `host`
- `admin_password`
Dynamic environment variables,
automatically set in tests:
- `access_token`
# 6. Protected Routes [Admin access]
Few routes are protected with `jwtCheck` middleware.
Requests going to these routes require `Authorization: Bearer {token}` header.
**Protected Routes**
- [Link][update,delete]
**Getting access token**
Endpoint: `POST /auth/token`.
Body: `{ password: ADMIN_PASSWORD }`.
**Admin password**
`ADMIN_PASSWORD` is defined in `.env` file.
It defaults to `secret`.
# 7. Frontend
Written in `TypeScript`,
using `Vue.js` and `Vuetify`.
**Join the open-source development - [Github - StartedInCroatia - Frontend](https://github.com/AndromedaTechnology/StartedInCroatia)**.
Check the live version at [startedincroatia.com](https://startedincroatia.com).
# 8. Social
- [Medium](https://medium.com/@StartedInCroatia)
- [Twitter](https://twitter.com/StartedInCro)
Crafted with ❤️
by contributors around the 🌍 World and 🌌 Andromeda.