Skip to content

Commit 88e7454

Browse files
authored
Update README.md
1 parent acc2ef3 commit 88e7454

File tree

1 file changed

+16
-98
lines changed

1 file changed

+16
-98
lines changed

README.md

Lines changed: 16 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,24 @@
11
<p align="center"><img src="https://raw.githubusercontent.com/JavaWebStack/docs/master/docs/assets/img/icon.svg" width="100">
2-
3-
# Web-Framework
2+
<br><br>
3+
JWS Object Relational Mapping
4+
</p>
5+
6+
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/JavaWebStack/ORM/Maven%20Deploy/master)
7+
![GitHub](https://img.shields.io/github/license/JavaWebStack/ORM)
8+
![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo.javawebstack.org%2Forg%2Fjavawebstack%2FORM%2Fmaven-metadata.xml)
9+
![GitHub contributors](https://img.shields.io/github/contributors/JavaWebStack/ORM)
10+
![Lines of code](https://img.shields.io/tokei/lines/github/JavaWebStack/ORM)
11+
![Discord](https://img.shields.io/discord/815612319378833408?color=%237289DA&label=discord)
12+
![Twitter Follow](https://img.shields.io/twitter/follow/JavaWebStack?style=social)
13+
14+
## Introduction
415
The Web Framework combines multiple JavaWebStack libraries with glue code and helpers to allow fast web development
516

6-
7-
8-
# Getting started
9-
## Repository
10-
### Maven (pom.xml)
11-
```xml
12-
<repositories>
13-
<repository>
14-
<id>javawebstack</id>
15-
<url>https://repo.javawebstack.org</url>
16-
</repository>
17-
</repositories>
18-
19-
<dependencies>
20-
<dependency>
21-
<groupId>org.javawebstack</groupId>
22-
<artifactId>Web-Framework</artifactId>
23-
<version>1.0-SNAPSHOT</version>
24-
</dependency>
25-
26-
<dependency>
27-
<groupId>mysql</groupId>
28-
<artifactId>mysql-connector-java</artifactId>
29-
<version>8.0.22</version>
30-
<scope>compile</scope>
31-
</dependency>
32-
</dependencies>
33-
```
34-
`Build` [Buildscript for compilation with Maven](https://gist.github.com/JulianFun123/14b412245ecf0257c7819eb8dadc1438)
35-
36-
## Usage
37-
```java
38-
39-
public class ExampleApplication extends WebApplication {
40-
41-
protected void setupConfig(Config config) {
42-
Map<String, String> map = new HashMap<>();
43-
// Maps a config entry with an key for .get("key")
44-
map.put("EXAMPLE_KEY", "example.key");
45-
config.addEnvKeyMapping(map);
46-
47-
// Registers .env as a configuration and adds System envs
48-
config.addEnvFile(".env");
49-
50-
}
51-
52-
protected void setupModels(SQL sql) throws ORMConfigurationException {
53-
// The connection is going to be built by the credentials given in the config
54-
55-
ORMConfig config = new ORMConfig().setTablePrefix("example_"); // .setDefaultSize(255)
56-
// Registeres every Model in the Users package with the sql connection and ORMConfig
57-
ORM.register(User.class.getPackage(), sql, config);
58-
// Adds or updates the database structure
59-
ORM.autoMigrate();
60-
}
61-
62-
protected void setupServer(HTTPServer server) {
63-
server.beforeInterceptor(exchange -> {
64-
// Just an attrib example (Passes it through following routes & middlewares)
65-
exchange.attrib("user", Repo.get(User.class).get(exchange.header("example-user-id")));
66-
// Do not intercept
67-
return false;
68-
});
69-
70-
// Adds every Controller in the package of ExampleController and extends HttpController (recursive)
71-
server.controller(HttpController.class, ExampleController.class.getPackage());
72-
}
73-
74-
75-
}
76-
77-
```
78-
79-
```java
80-
@PathPrefix("/user")
81-
public class ExampleController extends HttpController {
82-
@Get("/{id}")
83-
public String getUser(Exchange exchange, @Attrib("user") User user) {
84-
return user.name;
85-
}
86-
}
87-
```
88-
```java
89-
public class User extends Model {
90-
@Column
91-
public int id;
92-
93-
@Column
94-
public String name;
95-
}
96-
```
97-
98-
99-
100-
- Docs: https://javawebstack.org/framework/
101-
- Example Project https://github.com/javawebstack/
17+
## Documentation
18+
You can find the current docs on our [website](https://docs.javawebstack.org/framework). This is a work-in-progress project though so it's not yet complete.
10219

10320
## Community
10421
### JWS Modules
10522
- [JWS-GraphQL](https://github.com/x7airworker/JWS-GraphQL)
10623
### Projects built with JWS
24+
- [InteraApps Passwords](https://github.com/interaapps/passwords-backend)

0 commit comments

Comments
 (0)