Skip to content

Commit 80742ff

Browse files
author
App Generator
committed
Release v1.0.0 - Stable
1 parent 3d70d1f commit 80742ff

File tree

3 files changed

+131
-24
lines changed

3 files changed

+131
-24
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Change Log
22

3+
## [1.0.0] 2021-11-15
4+
### Stable Version
5+
6+
- Tested with POSTMAN / React APPS
7+
- [React Berry](https://github.com/app-generator/react-berry-dashboard)
8+
- [React Purity](https://github.com/app-generator/react-purity-dashboard)
9+
- [React Soft Dashboard](https://github.com/app-generator/react-soft-ui-dashboard)
10+
- [React Datta Able](https://github.com/app-generator/react-datta-able)
11+
312
## [0.0.2] 2021-09-01
413
### Env Improvements
514

README.md

+116-22
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,79 @@
1-
Laravel API Server
2-
==================
31

4-
![CI](https://github.com/app-generator/api-server-laravel/workflows/CI/badge.svg?branch=master)
2+
# [Laravel API Server](https://docs.appseed.us/boilerplate-code/api-server/laravel)
53

6-
Simple starter built with PHP (Laravel), Sqlite3 and JWT.
4+
Simple Laravel API Server with JWT authentication, and **SQLite** persistance - Provided by **AppSeed** [App Generator](https://appseed.us) and [UPDIVISION](https://updivision.com/?ref=appseed)
75

8-
## ✨ Requirements
6+
7+
<br />
8+
9+
> Features:
10+
11+
- [API Definition](https://docs.appseed.us/boilerplate-code/api-unified-definition) - the unified API structure implemented by this server
12+
- Simple, intuitive codebase - can be extended with ease.
13+
- **Stack**: PHP 7.4+ / Laravel / Doctrine
14+
- JWT Authentication
15+
16+
<br />
17+
18+
> Can be used with other [React Starters](https://appseed.us/apps/react) for a complete **Full-Stack** experience:
19+
20+
| [React Node JS Berry](https://appseed.us/product/react-node-js-berry-dashboard) | [React Node Soft Dashboard](https://appseed.us/product/node-js-react-soft-dashboard) | [React Node Datta Able](https://github.com/app-generator/react-datta-able) |
21+
| --- | --- | --- |
22+
| [![React Node JS Berry](https://user-images.githubusercontent.com/51070104/124934742-aa392300-e00d-11eb-83bf-28d8b8704ec8.png)](https://appseed.us/product/react-node-js-berry-dashboard) | [![React Node Soft Dashboard](https://user-images.githubusercontent.com/51070104/137918158-54b20cce-1ac8-4279-ab89-aac0353ff7d3.png)](https://appseed.us/product/node-js-react-soft-dashboard) | [![React Node Datta Able](https://user-images.githubusercontent.com/51070104/125737710-834a9e6f-c39b-4f3b-a42a-9583ce2ce1da.png)](https://github.com/app-generator/react-datta-able)
23+
24+
<br />
25+
26+
![Nodejs API Server - Open-source Nodejs Starter provided by AppSeed.](https://user-images.githubusercontent.com/51070104/124414813-142aa180-dd5c-11eb-9279-6b082dadc51a.png)
27+
28+
<br />
29+
30+
## Requirements
931

1032
- PHP 7.4+
1133
- Extensions (check the #Troubleshooting section for installation info)
1234
- `php-xml`
1335
- `php7.4-sqlite`
36+
37+
<br />
38+
39+
## How to use the code
1440

15-
## 🚀 Installation
41+
**Step #1** - Clone the project
1642

1743
```bash
18-
composer install && \
19-
cp .env.example .env && \
20-
php artisan key:generate
44+
$ git clone https://github.com/app-generator/api-server-laravel.git
45+
$ cd api-server-laravel
2146
```
2247

23-
Authentication is based on JWT, so generating a secret in your `.env` is needed:
48+
**Step #2** - Install dependencies
2449

2550
```bash
26-
php artisan jwt:secret
51+
$ composer install
52+
$ cp .env.example .env
53+
$ php artisan key:generate
2754
```
2855

29-
## 🖥 Databases
56+
**Step #3** - Generate a `secret` key used by JWT Authentication Flow
3057

31-
The default database driver is `SQLite`, so you need to create the database file:
32-
33-
```bash
34-
touch database/database.sqlite
58+
```
59+
$ php artisan jwt:secret
3560
```
3661

37-
Run migrations using `artisan migrate`:
62+
**Step #4** - Set up the database
3863

3964
```bash
40-
php artisan migrate
65+
$ touch database/database.sqlite
66+
$ php artisan migrate
4167
```
4268

43-
<br />
44-
45-
Start the API server
69+
**Step #5** - Start the server
4670

4771
```bash
4872
$ php -S localhost:5000 server.php
4973
```
5074

75+
<br />
76+
5177
## Troubleshooting
5278

5379
To have a successfull compilation of this product make sure you have the following PHP extentions installed and enabled:
@@ -60,5 +86,73 @@ $ # Php XML - required by Php Unit
6086
$ sudo apt install php-xml php-cli php-mbstring php7.4-sqlite
6187
```
6288

89+
<br />
90+
91+
## Codebase Structure
92+
93+
```bash
94+
< ROOT >
95+
|
96+
|-- app/ # Implements APP Bussiness Logic
97+
|-- config/ # Configuration
98+
|-- public/ # Public folder
99+
|-- routes/ # Application ROutes
100+
|-- tests/ # Tests
101+
|
102+
|-- server.js # API Entry Point
103+
|-- .env # Specify the ENV variables
104+
|
105+
|-- ************************************************************************
106+
```
107+
108+
<br />
109+
110+
## API
111+
112+
For a fast set up, use this POSTMAN file: [api_sample](https://github.com/app-generator/api-server-nodejs-pro/blob/master/media/api.postman_collection.json)
113+
114+
> **Register** - `api/users/register`
115+
116+
```
117+
POST api/users/register
118+
Content-Type: application/json
119+
120+
{
121+
"username":"test",
122+
"password":"pass",
123+
"email":"test@appseed.us"
124+
}
125+
```
126+
127+
<br />
128+
129+
> **Login** - `api/users/login`
130+
131+
```
132+
POST /api/users/login
133+
Content-Type: application/json
134+
135+
{
136+
"password":"pass",
137+
"email":"test@appseed.us"
138+
}
139+
```
140+
141+
<br />
142+
143+
> **Logout** - `api/users/logout`
144+
145+
```
146+
POST api/users/logout
147+
Content-Type: application/json
148+
authorization: JWT_TOKEN (returned by Login request)
149+
150+
{
151+
"token":"JWT_TOKEN"
152+
}
153+
```
154+
155+
<br />
156+
63157
---
64-
Laravel API Server - provided by UPDIVISION and [App Generator](https://updivision.com/)
158+
**[Laravel API Server](https://docs.appseed.us/boilerplate-code/api-server/laravel)** - provided by AppSeed [App Generator](https://appseed.us)

package.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
"private": true,
2+
"name": "api-server-nodejs",
3+
"version": "1.0.0",
4+
"description": "RESTful back-end for Node.js and Express.js",
5+
"license": "MIT License",
6+
"author": "AppSeed.us",
37
"scripts": {
48
"dev": "npm run development",
59
"development": "mix",
@@ -15,4 +19,4 @@
1519
"lodash": "^4.17.19",
1620
"postcss": "^8.1.14"
1721
}
18-
}
22+
}

0 commit comments

Comments
 (0)