GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - forma-at/forma-core: 🗄️ Forma RESTful API service

BranchesTags
Open more actions menu

Latest commit

 

History

216 Commits
216 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
docs
docs
 
 
scripts
scripts
 
 
src
src
 
 
.eslintignore
.eslintignore
 
 
.eslintrc
.eslintrc
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 

Repository files navigation

forma-core

RESTful API service to create, read, update and delete data from the web and mobile applications.

Usage

1. Clone this repository using the terminal command or GitHub Desktop.

git clone https://github.com/Forma-AT/forma-core.git

2. Install the dependencies using npm

npm i

3. Create a file in the project root directory named .env and place the following content in it. Make sure to replace these placeholder values with the actual secrets and connection details you wish to use. The recommended JWT secret is an at least 20 characters long random generated string.

PORT=5000
MONGODB_HOST="localhost"
MONGODB_PORT=27017
MONGODB_POOLSIZE=20
MONGODB_NAME="forma"
JWT_SECRET=""

4. Start the server in development mode with TypeScript compilation and hot-reloading enabled

npm run dev

5a. (optional) Compile source code manually

npm run build

5b. (optional) Start the server in production mode

npm run prod

6. Access the API using any client (e.g. Postman) at

http://localhost:5000/api

API endpoints

For an exhaustive list of all available API endpoints, authorization information, request and response parameters, as well as request and response samples view the API documentation written in OpenAPI 3 format at docs/core-api.yaml. To run a user-friendly API documentation server using redoc-cli run the following command:

npm run api

or to run the API server in watch mode (no hot-reloading)

npm run api:dev

and then open the documentation server in the browser at

http://localhost:8080/

Generate mock data

When testing the API endpoints or the front-end UI it can come in handy to have test users ready, and manual creation can be tedious. The following command will generate 15 school and 15 teacher accounts, all fully configured and set up. None of the users will have memberships or classes by default.

npm run gen-mock-data

Keep in mind that this should only be run once, otherwise you might end up with duplicate users. To customize the mock data before running the command you can edit the files under scripts/mock. The generated users will have the following format by default:

Type Email Password
school [email protected] Testing123
school [email protected] Testing123
... ... ...
school [email protected] Testing123
school [email protected] Testing123
teacher [email protected] Testing123
teacher [email protected] Testing123
... ... ...
teacher [email protected] Testing123
teacher [email protected] Testing123

About

🗄️ Forma RESTful API service

forma-at.github.io/forma-core/

Topics

apibackendexpressformamongodbresttypescript

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.